﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using JM.JCY.Proxy;
using JM.JCY.BusinessEntity.DSJCYD94;

namespace JM.JCY.SharePointComponent.CaseManagement.CaseKeyPoint
{
    public partial class CaseKeyPointUserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GridViewDataBind();
            }
        }

      

        protected void gvCaseWarning_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            this.gvCaseWarning.PageIndex = e.NewPageIndex;
            GridViewDataBind();
        }

        private void GridViewDataBind()
        {
            using (DSJCYD94Proxy proxy = new DSJCYD94Proxy())
            {
                CaseManagementDataSet.T_AJGL_AJJK_ZJJDAJDataTable dt = proxy.GetKeyPointCase();
                if (dt.Rows.Count > 0)
                    this.NoRecord.Visible = false;
                else
                    this.NoRecord.Visible = true;

                this.gvCaseWarning.DataSource = dt;
                this.gvCaseWarning.DataBind();
            }
        }
    }
}
